﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace game
{
    public class ProximityMine : Projectile
    {

        private static ModelUnit modelInst = null;

        public static ProximityMine Create(Scene scene, Ship shooter, int layerIndex, Vector3 position, Vector3 rotation)
        {
            if (modelInst == null)
            {
                modelInst = new ModelUnit(ShooterGame.Instance.Content.Load<Model>("Models\\mine"),
                    Matrix.CreateScale(18f));
                
            }
            return new ProximityMine(scene, shooter, modelInst, layerIndex, position, rotation);
        }

        public ProximityMine(Scene scene, Ship shooter, ModelUnit model, int layerIndex, Vector3 position, Vector3 rotation)
            : base(scene, shooter, model, layerIndex, position, rotation)
        {
            this.moveSpeed = 0;
            this.Health = 2.0f;
            this.MaxHealth = this.Health;
            this.damage = 100.0f;
            this.lifeTimeMs = 5 * 60 * 1000;
            
        }

        protected override void Explode()
        {
            scene.ExplosionMgr.SmallRedExplosion(position);
        }
    }
}
